//
//  ConnectionDelegate.h
//  mUBB
//
//  Created by Cosmin Stirbu on 1/13/13.
//  Copyright (c) 2013 Cosmin Stirbu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "WSResponse.h"
#import "JSONKit.h"
#import "NSDictionary+NullHandler.h"
#import "WSError.h"
#import "Constants.h"
#import "NSString+Empty.h"
#import "JSONTags.h"
#import "Ticket.h"


@interface ConnectionDelegate : NSObject {
    // WSResponse
    WSResponse *_response;
}

// Response Handler: The object that will be notified with the parsed model
@property(nonatomic, strong) id delegate;

// Ticket
@property(nonatomic, strong) Ticket *ticket;

// Constructor
- (id)initWithDelegate:(id)_delegate ticket:(Ticket *)_ticket;

// Handle response
- (void)didReceiveResponse:(WSResponse *)response;

// Handle Error
- (void)didFailWithError:(NSError *)error;

// Handle succes (usually means parsing the response data) will be implemented by subclasses
- (void)handleSuccess:(WSResponse *)response;

// Handle failure status codes such as 400, 401, 404. Will be implemented by subclasses
- (void)handleError:(WSError *)error;

@end
